<template>
  <div class="common-layout">
    <el-container>
      <el-header class="mb-2">供应链金融管理平台</el-header>
      <!-- ==================================================== aside ==================================================================== -->
      <el-container>
        <el-aside width="250px">
          <el-row class="tac">
            <el-col :span="24">
              <el-menu
                router
                active-text-color="#ffd04b"
                background-color="rgba(78, 171, 254, 1)"
                class="el-menu-vertical-demo"
                default-active=""
                text-color="#fff"
                @open="handleOpen"
                @close="handleClose"
                style="border: none"
                @select="handleSelect"
              >
                <el-menu-item index="1">
                  <el-icon size="30"><HomeFilled /></el-icon>
                  <span class="home_page">首页</span>
                </el-menu-item>
                <el-sub-menu index="2">
                  <template #title>
                    <span>信用评级</span>
                  </template>
                  <el-menu-item index="2-1" route="/home/credit/creditcard"
                    >评分卡</el-menu-item
                  >
                  <el-menu-item index="2-2" route="/home/credit/credita"
                    >评分等级</el-menu-item
                  >
                  <el-menu-item index="2-3" route="/home/credit/creditb"
                    >评级分类</el-menu-item
                  >
                </el-sub-menu>
                <el-sub-menu index="3">
                  <template #title>
                    <span>客户管理</span>
                  </template>
                  <el-menu-item index="3-1" route="/home/client/clienta"
                    >核心企业管理</el-menu-item
                  >
                  <el-menu-item index="3-2" route="/home/client/clientb"
                    >上下游企业管理</el-menu-item
                  >
                  <el-menu-item index="3-3" route="/home/client/clientc"
                    >客户黑名单管理</el-menu-item
                  >
                </el-sub-menu>
                <el-sub-menu index="4">
                  <template #title>
                    <span>担保物管理</span>
                  </template>
                  <el-menu-item index="4-1" route="/home/guarantee/Guaranteea"
                    >担保物管理</el-menu-item
                  >
                  <el-menu-item index="4-2" route="/home/guarantee/Guaranteeb"
                    >担保物审批</el-menu-item
                  >
                </el-sub-menu>
                <el-sub-menu index="5">
                  <template #title>
                    <span>贷前管理</span>
                  </template>
                  <el-menu-item index="5-1" route="/home/preloan/preloana"
                    >核心企业授信审批</el-menu-item
                  >
                  <el-menu-item index="5-2" route="/home/preloan/preloanb"
                    >上下游企业贷款申请</el-menu-item
                  >
                </el-sub-menu>
                <el-sub-menu index="6">
                  <template #title>
                    <span>核心企业授信审批</span>
                  </template>
                  <el-menu-item index="6-1" route="/home/extension/extensiona"
                    >核心企业授信申请</el-menu-item
                  >
                  <el-menu-item index="6-2" route="/home/extension/extensionb"
                    >逐级审批</el-menu-item
                  >
                  <el-menu-item index="6-3" route="/home/extension/extensionc"
                    >设置参会人</el-menu-item
                  >
                  <el-menu-item index="6-4" route="/home/extension/extensiond"
                    >贷审会会审</el-menu-item
                  >
                  <el-menu-item index="6-5" route="/home/extension/extensione"
                    >授信结果登记</el-menu-item
                  >
                  <el-menu-item index="6-6" route="/home/extension/extensionf"
                    >贷审会主任</el-menu-item
                  >
                </el-sub-menu>
                <el-sub-menu index="7">
                  <template #title>
                    <span>核心企业贷款审批</span>
                  </template>
                  <el-menu-item index="7-1" route="/home/loans/loansa"
                    >逐级审批</el-menu-item
                  >
                  <el-menu-item index="7-2" route="/home/loans/loansb"
                    >批贷结果登记</el-menu-item
                  >
                </el-sub-menu>
                <el-sub-menu index="8">
                  <template #title>
                    <span>上下游企业贷款审批</span>
                  </template>
                  <el-menu-item index="8-1" route="/home/upandown/upandowna"
                    >逐级审批</el-menu-item
                  >
                  <el-menu-item index="8-2" route="/home/upandown/upandownb"
                    >设置参会人</el-menu-item
                  >
                  <el-menu-item index="8-3" route="/home/upandown/upandownc"
                    >贷审会会审</el-menu-item
                  >
                  <el-menu-item index="8-4" route="/home/upandown/upandownd"
                    >批贷结果登记</el-menu-item
                  >
                  <el-menu-item index="8-5" route="/home/upandown/upandowne"
                    >贷审会主任</el-menu-item
                  >
                </el-sub-menu>
                <el-sub-menu index="9">
                  <template #title>
                    <span>合同管理</span>
                  </template>
                  <el-menu-item index="9-1" route="/home/contract/contracta"
                    >核心企业合同签订</el-menu-item
                  >
                  <el-menu-item index="9-2" route="/home/contract/contractb"
                    >上下游企业合同签订</el-menu-item
                  >
                </el-sub-menu>
                <el-sub-menu index="10">
                  <template #title>
                    <span>放款管理</span>
                  </template>
                  <el-menu-item index="10-1" route="/home/loan/loana"
                    >风控审核</el-menu-item
                  >
                  <el-menu-item index="10-2" route="/home/loan/loanb"
                    >法务审核</el-menu-item
                  >
                  <el-menu-item index="10-3" route="/home/loan/loanc"
                    >财务总监审核</el-menu-item
                  >
                  <el-menu-item index="10-4" route="/home/loan/loand"
                    >放款审核</el-menu-item
                  >
                </el-sub-menu>
                <el-sub-menu index="11">
                  <template #title>
                    <span>贷后管理</span>
                  </template>
                  <el-menu-item index="11-1" route="/home/postloan/postloana"
                    >还款管理</el-menu-item
                  >
                  <el-menu-item index="11-2" route="/home/postloan/postloanb"
                    >逾期催收管理</el-menu-item
                  >
                  <el-menu-item index="11-3" route="/home/postloan/postloanc"
                    >贷款五级分类</el-menu-item
                  >
                  <el-menu-item index="11-4" route="/home/postloan/postloand"
                    >资产保全</el-menu-item
                  >
                </el-sub-menu>
                <el-sub-menu index="12">
                  <template #title>
                    <span>报表管理</span>
                  </template>
                  <el-menu-item index="12-1" route="/home/excel/excela"
                    >核心企业月度计息表</el-menu-item
                  >
                  <el-menu-item index="12-2" route="/home/excel/excelb"
                    >核心企业贷款项目汇总表</el-menu-item
                  >
                  <el-menu-item index="12-3" route="/home/excel/excelc"
                    >核心企业贷款业务汇总表</el-menu-item
                  >
                  <el-menu-item index="12-4" route="/home/excel/exceld"
                    >核心企业贷款业务统计</el-menu-item
                  >
                  <el-menu-item index="12-5" route="/home/excel/excele"
                    >上下游企业月度计息表</el-menu-item
                  >
                  <el-menu-item index="12-6" route="/home/excel/excelf"
                    >上下游企业贷款项目汇总</el-menu-item
                  >
                  <el-menu-item index="12-7" route="/home/excel/excelg"
                    >上下游企业贷款业务汇总</el-menu-item
                  >
                  <el-menu-item index="12-8" route="/home/excel/excelh"
                    >上下游企业贷款业务统计</el-menu-item
                  >
                </el-sub-menu>
                <el-sub-menu index="13">
                  <template #title>
                    <span>系统设置</span>
                  </template>
                  <el-menu-item index="13-1" route="/home/systemset/systemseta"
                    >用户管理</el-menu-item
                  >
                  <el-menu-item index="13-2" route="/home/systemset/systemsetb"
                    >角色管理</el-menu-item
                  >
                </el-sub-menu>
              </el-menu>
            </el-col>
          </el-row>
        </el-aside>
        <!-- ======================================================  main  ================================================================ -->
        <el-main>
          <MyBreadCrumb />
          <!-- 二级路由出口 -->
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup>
import MyBreadCrumb from "@/components/MyBreadCrumb.vue";
import { useMenuStore } from "@/stores/menu"; //引入保存路径数据 pinia
var menuStore = useMenuStore();
var handleSelect = (index, indexPath) => {
  // console.log(indexPath[1]);
  menuStore.save_menupath(indexPath); //保存 菜单路径
};
</script>

<style scoped>
/* .tac {
  width: 450px;
} */
.mb-2 {
  color: rgba(78, 171, 254, 1);
  font-weight: 700;
  font-size: 20px;
  line-height: 60px;
}
.el-aside {
  border-radius: 0 50px 0 0;
}
.home_page {
  font-size: 20px;
}
.el-main{
  margin: 30px;
  background-color: rgb(253, 252, 252);
}
</style>